//
// Created by Semir on 2020/5/12.
//

#include <iostream>

using namespace std;

struct ListNode {
    int val;
    struct ListNode *next;
    explicit ListNode(int x) : val(x), next(nullptr) {}
};

ListNode* Merge(ListNode* pHead1, ListNode* pHead2) {
    if (pHead1 == nullptr) {
        return pHead2;
    }
    if (pHead2 == nullptr) {
        return pHead1;
    }
    if (pHead1->val <= pHead2->val) {
        pHead1->next = Merge(pHead1->next, pHead2);
        return pHead1;
    } else {
        pHead2->next = Merge(pHead1, pHead2->next);
        return pHead2;
    }
}

int main() {

    return 0;
}